package org.itsolutions.javaBackup.spi;

import org.itsolutions.javaBackup.exceptions.AException;

/**
 * Service with lifecycle. Service can be started / stopped.
 * @author Tomas Fecko
 */
public interface IServiceWithLifecycle {

	/**
	 * Method starts the service. Service is running, until it's stopped.
	 * @throws AException any exception during the service starting
	 */
	void startService() throws AException;
	
	/**
	 * Stops the service. After stop is called, nothing from the server should remain present.
	 * @throws AException any exception during the service stopping.
	 */
	void stopService() throws AException;
	
	/**
	 * Method returns true, if it's started. (Start was called (and no exception occurred), and than no stop was called (and no exception occurred).)
	 * @return true, if service is started
	 */
	boolean isStarted();
}





